@echo off
@chcp 65001 >nul

md build 2>nul | del build\* /Q /F

rem g++ main.cpp -o main.exe -Llib -leasyx -Iinclude


g++ -c src/easyc.cpp -o easyc.o -Isrc -Ilib -Iinclude -static

rem 动态库版本
rem g++ -shared -o libeasyc.dll easyc.o -Wl,--whole-archive lib/libeasyx.a -Wl,--no-whole-archive -lstdc++

rem 静态库版本
md build\lib_objs 2>nul | del build\lib_objs\* /Q /F
cd build\lib_objs
ar x ../../lib/libeasyx.a
cd ..\..
ar rcs libeasyc.a easyc.o build/lib_objs/*.o

gcc main.c -o app -L. -leasyc -lstdc++ -Iinclude